package com.example.ruralservicedigitalplatform.controller.villager;

import com.example.ruralservicedigitalplatform.comment.Result;
import com.example.ruralservicedigitalplatform.domain.po.Item;
import com.example.ruralservicedigitalplatform.service.ItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("villagerItemController")
@Slf4j
@RequestMapping("/villager/item")
@Tag(name = "商店相关接口")
public class ItemController {
    @Autowired
    private ItemService itemService;
    @GetMapping("/list")
    @Operation(summary = "根据分类id查询商品列表")
    public Result<List<Item>> list(Long id){
        List<Item> list = itemService.list(id);
        return Result.success(list);
    }

}
